<template>
  <div>
    <el-table
        :data="browseHistory"
        style="width: 100%"
        @row-click="clickRow"
    >
      <el-table-column
          type="index"
          label="序号">
      </el-table-column>
      <el-table-column
          prop="update_time"
          label="浏览时间"
          width="180">
      </el-table-column>
      <el-table-column
          prop="label"
          label="工作标题">


      </el-table-column>
      <el-table-column
          prop="city"
          label="城市">
      </el-table-column>
      <el-table-column
          prop="salary"
          label="薪资范围">
      </el-table-column>
      <el-table-column
          prop="work_type"
          label="工作类型">
      </el-table-column>
      <el-table-column
          prop="company.name"
          label="公司名称"
          width="250">
      </el-table-column>

    </el-table>
  </div>
</template>

<script>
import {Record} from "@/API/api";

export default {
  data() {
    return {
      browseHistory: [  // 浏览记录数据
      ]
    };
  },
  methods: {
    getRecord() {
      this.$api.Record().then(rep => {
        this.browseHistory = rep.data
      })
    },
    clickRow(row) {
      this.$router.push({"name": "JobDetail", params: {jobId: row.id}})
    }
  },

  beforeMount() {
    this.getRecord()
  }
};
</script>
